1. Field of the Invention
The invention relates to computers and computer memory. More particularly, the invention relates to a method, apparatus and article of manufacture for managing a reusable linear access storage medium.
2. Background of the Related Art
All computer systems store data on some type of storage medium having a finite storage capacity. The storage medium may be configured as a plurality of media blocks that are reusable. To facilitate the storage of data on such a limited capacity storage medium, an operating system assigns an “expiration date” to data blocks stored on the storage medium. A data block may comprise one data file, multiple data files or a portion of one data file. The use of expiration dates provides a measure of how long a particular data block is needed on the storage medium. The data block is considered active prior to the expiration date, but is considered expired after the expiration date.
The storage medium is classified as a random access medium or a linear (or sequential) access medium depending on how data blocks are accessed on the storage medium by a storage access device. In a random access medium, data block is directly accessible without the need to access any other data block. The random access medium, e.g., DVD-RAM (digital video disk random access memory), is generally limited to fixed size media blocks to enable data access. In contrast, a linear or sequential access medium may require access to other data blocks before an access of a particular data block. Linear access medium (or linear medium), e.g., magnetic tapes, may have variable size media blocks.
For linear access mediums, the operating system may track or monitor the different media blocks containing active data blocks within a media set, i.e., a plurality of media blocks, by using a “media header label” for each media block. The media header label contains information on the first media block of the media set and a media block sequence (MBSQ) number of the particular media block. The media block sequence number is indicative of a position of the media block in the media set. For example, the first media block used to store data blocks would have the lowest MBSQ number, while the last media block used to store data blocks would have the highest MBSQ number in the media set. Moreover, the operating system also assigns data block sequence numbers for data blocks, stored in each media set. These data block sequence numbers are indicative of the order in storing the data blocks in the media set.
Over time, some of these data blocks in the media set will become expired, i.e., the expiration date has passed for these data blocks. Although such expired data blocks are no longer used used by the computer system, the data blocks still occupy media blocks in the storage medium. As such, the operating system needs to remove the expired files such that these media blocks are reusable.
However, removing expired data blocks from the media set causes problems in tracking data blocks in the media set. For example, when a media block is initially used or reused for storage of data blocks, a media header label is appended to the media block. The media header label contains a reference to the “first media block” in the media set used to store data blocks. If this first media block no longer contains active data, the first media block is identified for removal from the media set. After removal of this first media block from the media set, the media header label for the remaining media blocks would reference a media block, i.e., the first media block, that is no longer part of the media set. As such, the media header label is no longer correctly referencing the first media block in the updated media set.
There are currently several possible approaches to resolve the problems associated with handling the media set in response to expired data blocks. One approach requires a user to manually remove media blocks that no longer contain any active data blocks, i.e., media blocks that only contain expired data blocks, from the media set. The removed media blocks are placed in a scratch pool of media blocks available for reuse or future storage. Although this approach allocates media blocks are for immediate reuse, a problem exists when a media block removed as the first media block of one media set is then reused as the first media block of another media set. This causes media blocks from two different media sets to reference the first media block, and corresponding confusion for the operating system. Moreover, if the first media block is removed and subsequently reused in the first media set, the media block would still be erroneously referenced, even though it no longer the oldest media block used to store the oldest data blocks.
A second approach stores new data blocks into a new media set. Media blocks in an existing media set are not affected or reused until all data blocks in that media set are expired. As such, this approach does not allocate media blocks for immediate reuse when that media block contains only expired data blocks. Moreover, if a last or last-added media block in the media set has not fully used its entire memory for storage, that unused memory is wasted. Thus, the approach fails to efficiently use all media blocks of a media set.
Thus, there is a need to provide accurate and efficient management of media blocks and associated media sets in a reusable linear access storage medium.